<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateSettingsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('settings', function (Blueprint $table) {
            $table->increments('id');
            $table->string('name');
            $table->string('value');
            $table->string('discription');
            $table->timestamps();
        });
        DB::table('settings')->insert(
            array(
                array(
                    'id' => 1,
                    'name' => 'QYH_CORPID',
                    'value' => '',
                    'discription' => '企业ID',
                    'created_at' => date('Y-m-d H:i:s'),
                    'updated_at' => date('Y-m-d H:i:s')
                ),
                array(
                    'id' => 2,
                    'name' => 'QYH_AGENTID',
                    'value' => '',
                    'discription' => '授权方应用ID',
                    'created_at' => date('Y-m-d H:i:s'),
                    'updated_at' => date('Y-m-d H:i:s')
                ),
                array(
                    'id' => 3,
                    'name' => 'QYH_SECRET',
                    'value' => '',
                    'discription' => '应用的凭证密钥',
                    'created_at' => date('Y-m-d H:i:s'),
                    'updated_at' => date('Y-m-d H:i:s')
                ),
                array(
                    'id' => 4,
                    'name' => 'STU_STORAGE',
                    'value' => '1048576',
                    'discription' => '学生存储空间(KB)',
                    'created_at' => date('Y-m-d H:i:s'),
                    'updated_at' => date('Y-m-d H:i:s')
                ),
                array(
                    'id' => 5,
                    'name' => 'STU_DOWNLOAD_RATE',
                    'value' => '1024',
                    'discription' => '学生下载速度(k/s)',
                    'created_at' => date('Y-m-d H:i:s'),
                    'updated_at' => date('Y-m-d H:i:s')
                ),
                array(
                    'id' => 6,
                    'name' => 'STU_MONOFILE_SIZE',
                    'value' => '1048576',
                    'discription' => '学生单文件大小(KB)',
                    'created_at' => date('Y-m-d H:i:s'),
                    'updated_at' => date('Y-m-d H:i:s')
                ),
                array(
                    'id' => 7,
                    'name' => 'TCH_STORAGE',
                    'value' => '2097152',
                    'discription' => '教师存储空间(KB)',
                    'created_at' => date('Y-m-d H:i:s'),
                    'updated_at' => date('Y-m-d H:i:s')
                ),
                array(
                    'id' => 8,
                    'name' => 'TCH_DOWNLOAD_RATE',
                    'value' => '2048',
                    'discription' => '教师下载速度(k/s)',
                    'created_at' => date('Y-m-d H:i:s'),
                    'updated_at' => date('Y-m-d H:i:s')
                ),
                array(
                    'id' => 9,
                    'name' => 'TCH_MONOFILE_SIZE',
                    'value' => '2097152',
                    'discription' => '教师单文件大小(KB)',
                    'created_at' => date('Y-m-d H:i:s'),
                    'updated_at' => date('Y-m-d H:i:s')
                ),
                array(
                    'id' => 10,
                    'name' => 'OTH_STORAGE',
                    'value' => '1048576',
                    'discription' => '其他存储空间(KB)',
                    'created_at' => date('Y-m-d H:i:s'),
                    'updated_at' => date('Y-m-d H:i:s')
                ),
                array(
                    'id' => 11,
                    'name' => 'OTH_DOWNLOAD_RATE',
                    'value' => '1024',
                    'discription' => '其他下载速度(k/s)',
                    'created_at' => date('Y-m-d H:i:s'),
                    'updated_at' => date('Y-m-d H:i:s')
                ),
                array(
                    'id' => 12,
                    'name' => 'OTH_MONOFILE_SIZE',
                    'value' => '1048576',
                    'discription' => '其他单文件大小(KB)',
                    'created_at' => date('Y-m-d H:i:s'),
                    'updated_at' => date('Y-m-d H:i:s')
                ),
                array(
                    'id' => 13,
                    'name' => 'PUB_STORAGE',
                    'value' => '1048576',
                    'discription' => '公共存储空间(KB)',
                    'created_at' => date('Y-m-d H:i:s'),
                    'updated_at' => date('Y-m-d H:i:s')
                ),
                array(
                    'id' => 14,
                    'name' => 'PUB_USED_STORAGE',
                    'value' => '0',
                    'discription' => '公共存储已使用空间(KB)',
                    'created_at' => date('Y-m-d H:i:s'),
                    'updated_at' => date('Y-m-d H:i:s')
                )
            ));
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('settings');
    }
}
